﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<!--Head-->
<head>
	<title>后台管理登录 - <?=$site->name ?></title>
	<?php $this->load->view( 'common/header' )?>
</head>
<!--Head Ends-->
<!--Body-->
<body>
    <div class="login-container animated fadeindown">
        <div class="loginbox bg-white">
            <div class="loginbox-title bordered-bottom-2 bordered-darkorange"><?=$site->name?> - 后台</div>

	        <div id="error"></div>
			<form id="login">
            <div class="loginbox-textbox">
                <input type="text" class="form-control" id="uid" placeholder="用户名" />
            </div>
            <div class="loginbox-textbox">
                <input type="password" class="form-control" id="password" placeholder="密码" />
            </div>
<!--            <div class="loginbox-forgot">
                <a href="mailto:asonsky@163.com">忘记密码?</a>
            </div>-->
            <div class="loginbox-submit">
                <button type="submit" id="login" class="btn btn-lg  btn-primary btn-block">登录</button>
            </div>
            </form>
<!--            <div class="loginbox-signup">
                <a href="<?=site_url('/reg') ?>">用户注册</a>
            </div>-->
        </div>
        <div class="logobox">
	        技术支持：<a href="http://www.wfweilan.com">蔚蓝工作室</a>
        </div>
    </div>

<?php $this->load->view( 'footer'); ?>
<script>
$('#uid').focus();
$('#login').bind( 'submit', function(e){
    $.post(
	    '<?=site_url('login/login_check')?>',
	    {
		    uid:$('#uid').val(),password:$('#password').val()
	    },
	    function( json ){
		    //error_clear();
		    data = eval( '(' + json + ')' );
		    if( data.status == 'error' ){
			    error( 'warning', data.error );
		    }else{
			    error( 'success', data.error );
			    window.location.href = '<?=site_url( '/index')?>';
		    }
	    }
    );
    return false;
});

</script>

</body>
<!--Body Ends-->
</html>
